Optimal. Leaf size=97 \[ \frac{b \left (a^2-b^2\right ) \tan (c+d x)}{d}-\frac{a \left (a^2-3 b^2\right ) \log (\cos (c+d x))}{d}-b x \left (3 a^2-b^2\right )+\frac{(a+b \tan (c+d x))^3}{3 d}+\frac{a (a+b \tan (c+d x))^2}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0818862, antiderivative size = 97, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.158, Rules used = {3528, 3525, 3475} \[ \frac{b \left (a^2-b^2\right ) \tan (c+d x)}{d}-\frac{a \left (a^2-3 b^2\right ) \log (\cos (c+d x))}{d}-b x \left (3 a^2-b^2\right )+\frac{(a+b \tan (c+d x))^3}{3 d}+\frac{a (a+b \tan (c+d x))^2}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3528
Rule 3525
Rule 3475
Rubi steps
\begin{align*} \int \tan (c+d x) (a+b \tan (c+d x))^3 \, dx &=\frac{(a+b \tan (c+d x))^3}{3 d}+\int (-b+a \tan (c+d x)) (a+b \tan (c+d x))^2 \, dx\\ &=\frac{a (a+b \tan (c+d x))^2}{2 d}+\frac{(a+b \tan (c+d x))^3}{3 d}+\int (a+b \tan (c+d x)) \left (-2 a b+\left (a^2-b^2\right ) \tan (c+d x)\right ) \, dx\\ &=-b \left (3 a^2-b^2\right ) x+\frac{b \left (a^2-b^2\right ) \tan (c+d x)}{d}+\frac{a (a+b \tan (c+d x))^2}{2 d}+\frac{(a+b \tan (c+d x))^3}{3 d}+\left (a \left (a^2-3 b^2\right )\right ) \int \tan (c+d x) \, dx\\ &=-b \left (3 a^2-b^2\right ) x-\frac{a \left (a^2-3 b^2\right ) \log (\cos (c+d x))}{d}+\frac{b \left (a^2-b^2\right ) \tan (c+d x)}{d}+\frac{a (a+b \tan (c+d x))^2}{2 d}+\frac{(a+b \tan (c+d x))^3}{3 d}\\ \end{align*}
Mathematica [C] time = 0.560727, size = 100, normalized size = 1.03 \[ \frac{-6 b \left (b^2-3 a^2\right ) \tan (c+d x)+9 a b^2 \tan ^2(c+d x)+3 \left ((a-i b)^3 \log (\tan (c+d x)+i)+(a+i b)^3 \log (-\tan (c+d x)+i)\right )+2 b^3 \tan ^3(c+d x)}{6 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.005, size = 133, normalized size = 1.4 \begin{align*}{\frac{ \left ( \tan \left ( dx+c \right ) \right ) ^{3}{b}^{3}}{3\,d}}+{\frac{3\,a{b}^{2} \left ( \tan \left ( dx+c \right ) \right ) ^{2}}{2\,d}}+3\,{\frac{\tan \left ( dx+c \right ){a}^{2}b}{d}}-{\frac{{b}^{3}\tan \left ( dx+c \right ) }{d}}+{\frac{{a}^{3}\ln \left ( 1+ \left ( \tan \left ( dx+c \right ) \right ) ^{2} \right ) }{2\,d}}-{\frac{3\,\ln \left ( 1+ \left ( \tan \left ( dx+c \right ) \right ) ^{2} \right ) a{b}^{2}}{2\,d}}-3\,{\frac{\arctan \left ( \tan \left ( dx+c \right ) \right ){a}^{2}b}{d}}+{\frac{\arctan \left ( \tan \left ( dx+c \right ) \right ){b}^{3}}{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.72276, size = 128, normalized size = 1.32 \begin{align*} \frac{2 \, b^{3} \tan \left (d x + c\right )^{3} + 9 \, a b^{2} \tan \left (d x + c\right )^{2} - 6 \,{\left (3 \, a^{2} b - b^{3}\right )}{\left (d x + c\right )} + 3 \,{\left (a^{3} - 3 \, a b^{2}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 6 \,{\left (3 \, a^{2} b - b^{3}\right )} \tan \left (d x + c\right )}{6 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.75936, size = 216, normalized size = 2.23 \begin{align*} \frac{2 \, b^{3} \tan \left (d x + c\right )^{3} + 9 \, a b^{2} \tan \left (d x + c\right )^{2} - 6 \,{\left (3 \, a^{2} b - b^{3}\right )} d x - 3 \,{\left (a^{3} - 3 \, a b^{2}\right )} \log \left (\frac{1}{\tan \left (d x + c\right )^{2} + 1}\right ) + 6 \,{\left (3 \, a^{2} b - b^{3}\right )} \tan \left (d x + c\right )}{6 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.461567, size = 128, normalized size = 1.32 \begin{align*} \begin{cases} \frac{a^{3} \log{\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} - 3 a^{2} b x + \frac{3 a^{2} b \tan{\left (c + d x \right )}}{d} - \frac{3 a b^{2} \log{\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac{3 a b^{2} \tan ^{2}{\left (c + d x \right )}}{2 d} + b^{3} x + \frac{b^{3} \tan ^{3}{\left (c + d x \right )}}{3 d} - \frac{b^{3} \tan{\left (c + d x \right )}}{d} & \text{for}\: d \neq 0 \\x \left (a + b \tan{\left (c \right )}\right )^{3} \tan{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 3.07469, size = 1341, normalized size = 13.82 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]